<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 发起网络请求 -->
    <script>
        //原生ajax
        //创建原生ajax
        let XHR =new XMLHttpRequest()
        //设置请求，get请求可以直接把参数写在地址栏
        XHR.open('get','http://192.168.0.30:8000/users/getname?username=张三')
        //发送请求
        XHR.send()
        XHR.onload = function(){
            let res = JSON.parse(XHR.response)
            console.log(JSON.parse(XHR.response));
            
            document.write(res.message)
        }
    </script>
</body>
</html>